package cn.gjxblog.api;

import cn.gjxblog.common.model.HttpResult;
import cn.gjxblog.common.model.PageCondition;
import cn.gjxblog.model.entity.Agency;
import cn.gjxblog.model.entity.User;
import com.github.pagehelper.PageInfo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author gjx
 * @version v1.0
 * @Description
 * @date 2018/12/18 15:14
 */
@FeignClient(value = "user-server",path = "/agency")
 public  interface AgencyServerFegin {

    @PostMapping("/addAgency")
    HttpResult addAgency(@RequestBody Agency agency);

    @GetMapping("/getAgent")
    HttpResult<User> getAgent(@RequestParam("id") String id);

    @GetMapping("/getAgency")
    HttpResult<Agency> getAgency(@RequestParam("id") String id);

    @GetMapping("/queryAgency")
    HttpResult<List<Agency>> queryAgency();

    @PostMapping("/queryAgent")
    HttpResult<PageInfo<User>> queryAgent(@RequestBody PageCondition pageCondition);

}
